#include "core/main.h"

void SparseIntVector::clear()
{
    _indices.clear();
}

void SparseIntVector::increment(int i)
{
    _indices.push_back(i);
}

double SparseIntVector::dot(const vector<double> &other) const
{
    double val = 0;
    for (auto it = _indices.begin(); it != _indices.end(); ++it) {
        int i = *it;
        val += other[i];
    }
    return val;
}